

define(['simple/Calculator'],function(Calculator) {
"use strict";
return {
	name:'Calcurator', 
	desc:'Testing simple claculator class',
	
	tests:[
		function add() {
			this.expect(Calculator.add(1,1)).toBeEqual(2);
			this.expect(Calculator.add(-1,1)).toBeEqual(0);
			this.expect(Calculator.add(1,-1)).toBeEqual(0);
			this.expect(Calculator.add(-1,-1)).toBeEqual(-2);
			this.expect(Calculator.add(0,1)).toBeEqual(1);
			this.expect(Calculator.add(1,0)).toBeEqual(1);
		},
		
		function sub() {
			this.expect(Calculator.sub(1,1)).toBeEqual(0);
			this.expect(Calculator.sub(-1,1)).toBeEqual(-2);
			this.expect(Calculator.sub(1,-1)).toBeEqual(2);
			this.expect(Calculator.sub(-1,-1)).toBeEqual(0);
			this.expect(Calculator.sub(0,1)).toBeEqual(-1);
			this.expect(Calculator.sub(1,0)).toBeEqual(1);
		},
		
		function mul() {
			this.expect(Calculator.mul(1,1)).toBeEqual(1);
			this.expect(Calculator.mul(-1,1)).toBeEqual(-1);
			this.expect(Calculator.mul(1,-1)).toBeEqual(-1);
			this.expect(Calculator.mul(-1,-1)).toBeEqual(1);
			this.expect(Calculator.mul(0,1)).toBeEqual(0);
			this.expect(Calculator.mul(1,0)).toBeEqual(0);
		},
		
		function div() {
			this.expect(Calculator.div(1,1)).toBeEqual(1);
			this.expect(Calculator.div(-1,1)).toBeEqual(-1);
			this.expect(Calculator.div(1,-1)).toBeEqual(-1);
			this.expect(Calculator.div(-1,-1)).toBeEqual(1);
			this.expect(Calculator.div(0,1)).toBeEqual(0);
			this.expect(function(){Calculator.div(1,0);}).toThrow(Error).withMessage("Can't divide by zero");
		}
	]
};
});